/*******************************************************************************
 * Copyright (c) Jerges A. Bello G. 2014. Reservado todos los derechos.
 ******************************************************************************/
package com.jabex.core.bussines;

import java.io.Serializable;
import java.util.List;

import com.jabex.common.exceptions.ErrorFunctionalException;
import com.jabex.common.exceptions.ErrorOperationalException;
import com.jabex.common.exceptions.WarningFunctionalException;
import com.jabex.common.to.MessageTO;
import com.jabex.common.to.UserTO;

/**
 * Created by Jerges Bello on 17/05/2014.
 */

public interface IUserBp extends Serializable {
	public static final String SERVICE_NAME = "userBp";

	/**
	 * insert a  new user
	 *
	 * @param userTO object witch contains info the user.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO insertUser(UserTO userTO) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * delete a  user
	 *
	 * @param id the user.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO deleteUser(String id) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * update a  new user
	 *
	 * @param userTO object witch contains info the user to update.
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public MessageTO updateUser(UserTO userTO) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * get  a  user by id
	 *
	 * @param id user from search
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public UserTO getUserById(int id) throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;

	/**
	 * get  all  users
	 *
	 * @return Object with response for transaction
	 * @throws WarningFunctionalException
	 * @throws ErrorFunctionalException
	 * @throws ErrorOperationalException
	 */
	public List<UserTO> getAllUser() throws WarningFunctionalException, ErrorFunctionalException, ErrorOperationalException;
}
